//
//  NSDate+Convenience.h
//  golfMaster
//
//  Created by 宋鹏程 on 14/7/14.
//  Copyright (c) 2014 Master. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSDate(Convenience)

+ (instancetype)dateWithServerGMT:(NSNumber *)GMTSince1970;
- (NSString *)sinceNowDescription;

@property (nonatomic, readonly) NSInteger year;
@property (nonatomic, readonly) NSInteger month;
@property (nonatomic, readonly) NSInteger day;
@property (nonatomic, readonly) NSInteger hour;
@property (nonatomic, readonly) NSInteger minute;
@property (nonatomic, readonly) NSInteger second;
@property (nonatomic, readonly) NSInteger week;
@property (nonatomic, readonly) NSInteger weekday;

- (instancetype)setYear:(NSInteger)year;
- (instancetype)setMonth:(NSInteger)month;
- (instancetype)setDay:(NSInteger)day;
- (instancetype)setHour:(NSInteger)hour;
- (instancetype)setMinute:(NSInteger)minute;
- (instancetype)setSecond:(NSInteger)second;
- (instancetype)setWeek:(NSInteger)week;
- (instancetype)setWeekday:(NSInteger)weekday;

- (instancetype)offsetYears:(NSInteger)years;
- (instancetype)offsetMonths:(NSInteger)months;
- (instancetype)offsetDays:(NSInteger)days;
- (instancetype)offsetHours:(NSInteger)hours;
- (instancetype)offsetMinutes:(NSInteger)minutes;
- (instancetype)offsetSeconds:(NSInteger)seconds;
- (instancetype)offsetWeek:(NSInteger)weeks;
- (instancetype)offsetWeekday:(NSInteger)weekdays;

- (NSString *)weekdayString;
- (NSString *)weekdayShortString;
- (NSString *)stringWithFormatter:(NSString *)format;

- (NSUInteger)numDaysInMonth;
- (NSUInteger)firstWeekDayInMonth;

@end
